
;;;separates LWPOLYLINEs to layers by elevations (10', 5', 2', & 1')
;;;
;;;	Author:	Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;		http://paracadd.com
;;;		All rights reserved.
;;;
;;;		COPYRIGHT: 1-8-09
;;;		   EDITED: 1-8-09
;;;
(defun C:ELEVLAYER ()
  (IF ustr NIL (LOAD "ustr" "\nFile USTR.LSP not loaded! "))
  (SETQ elev_10_layer (ustr 1 "Layer for 10' contours" (IF elev_10_layer elev_10_layer "C-TOPO2CN10") T))
  (SETQ elev_05_layer (ustr 1 "Layer for 5' contours" (IF elev_05_layer elev_05_layer "C-TOPO2CN05") T))
  (SETQ elev_02_layer (ustr 1 "Layer for 2' contours" (IF elev_02_layer elev_02_layer "C-TOPO4CN02") T))
  (SETQ elev_01_layer (ustr 1 "Layer for 1' contours" (IF elev_01_layer elev_01_layer "C-TOPO4CN01") T))
  (SETQ contour_ss (SSGET '((0 . "LWPOLYLINE"))))
  (SETQ contour_sslen (SSLENGTH contour_ss))
  (SETQ counter 0)
  (WHILE (< counter contour_sslen)
    (SETQ this_contour (ENTGET(SSNAME contour_ss counter)))
    (SETQ this_contour
           (SUBST
             (COND
               ((=(REM (CDR (ASSOC 38 this_contour)) 10)0)
                 (CONS 8 elev_10_layer))
               ((=(REM (CDR (ASSOC 38 this_contour)) 5)0)
                 (CONS 8 elev_05_layer))
               ((=(REM (CDR (ASSOC 38 this_contour)) 2)0)
                 (CONS 8 elev_02_layer))
               ((=(REM (CDR (ASSOC 38 this_contour)) 1)0)
                 (CONS 8 elev_01_layer))
             )
             (ASSOC 8 this_contour)
             this_contour
           )
    )
    (ENTMOD this_contour)
    (SETQ counter (1+ counter))
  )
  (PRINC)
)